package com.itheima.mapper;

import com.itheima.pojo.User;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

//这里是User表的SQL语句操作
public interface UserMapper {
    //登录SQL查询
    @Select("select * from user where username=#{username} and password=#{password}")
    User selectUser(@Param("username") String username, @Param("password") String password);

    //注册用户名查重SQL
    @Select("select * from user where username=#{username}")
    User selectUserName(String username);

    //注册用户添加SQL
    @Insert(" INSERT INTO user VALUES (null,#{username},#{password})")
    int insertUser(User user);


}
